package com.jash.labor.controller;


import com.jash.labor.entity.StationEnroll;
import com.jash.labor.service.StationEnrollService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/stationEnroll",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class StationEnrollController {
    @Resource
    private StationEnrollService stationEnrollService;
    @RequestMapping(value = "/add")
    public Object add(
            @RequestBody StationEnroll stationEnroll
    ){
        return stationEnrollService.add(stationEnroll);
    }

    @RequestMapping(value = "/edit")
    public Object edit(
            @RequestBody StationEnroll stationEnroll
    ){
        return stationEnrollService.edit(stationEnroll);
    }

    @RequestMapping(value = "/queryListPage")
    public Object queryListPage(
            @RequestParam(value = "stationEnrollId") String stationEnrollId,
            @RequestParam(value = "pageNo") Integer pageNo,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize
    ){
        return stationEnrollService.laborQueryStationEnrollList(stationEnrollId,pageNo,pageSize);
    }

    @RequestMapping(value = "/laborQueryStationEnrollList")
    public Object laborQueryStationEnrollList(
            @RequestParam(value = "content") String content,
            @RequestParam(value = "pageNo",required = false) Integer pageNo,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize
    ){
        return stationEnrollService.laborQueryStationEnrollList(content,pageNo,pageSize);
    }
}
